
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '                                       T O   T E S T   T H I S   E X A M P L E 
 
 '   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
 '   -   O p e n   T h e r e m i n o _ C o b o t   V 1 . 1 . 2 2   o r   m o r e   r e c e n t 
 
 '   -   L o a d   e x a m p l e   " T e s t _ A . t x t "   ( o r   T e s t B   o r   T e s t C   o r   T e s t D ) 
 
 '   -   I n   t h e   a p p   C o b o t   e n a b l e   " R e p e a t " 
 
 '   -   I n   t h e   a p p   C o b o t   p r e s s   " E x e c u t e " 
 
 
 
 V a r i a b l e   N u m e r i c   S l o t _ C o m m a n d s T o C o b o t   =   5 1 
 
 V a r i a b l e   N u m e r i c   S l o t _ R e s p o n s e s F r o m C o b o t   =   5 2 
 
 V a r i a b l e   N u m e r i c   S l o t _ C o m m a n d s F r o m C o b o t   =   5 3 
 
 L o o p 1 
 
 S t o p 
 
 
 
 L a b e l   L o o p 1 
 
 	 L o o p 2 
 
 R e t u r n 
 
 
 
 L a b e l   L o o p 2 
 
 	 P r i n t   S l o t T e x t ( S l o t _ R e s p o n s e s F r o m C o b o t ) 
 
 	 W a i t   S e c o n d s   0 . 1 
 
 	 I f   K e y ( " C T R L " ) 
 
 	 	 R e t u r n 
 
 	 E n d I f 
 
 G o t o   L o o p 2 
 
 
 
 L a b e l   E v e n t _ C o m m a n d s F r o m C o b o t 
 
 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   E x t r a c t   f i r s t   w o r d 
 
 	 S e l e c t   G e t S e p a r a t e d S t r i n g ( C o m m a n d T e x t ,   0 ) 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 C a s e   " B e e p " 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 E x e c B e e p 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 C a s e   " B e e p _ M u l t i p l e " 
 
 	 	 	 C l e a r C o m m a n d 
 
 	 	 	 E x e c B e e p M u l t i p l e 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 C a s e   " L o a d S e q u e n c e - T e s t _ A " 
 
 	 	 	 L o a d S e q u e n c e A 
 
 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 	 	 C a s e   " L o a d S e q u e n c e - T e s t _ B " 
 
 	 	 	 L o a d S e q u e n c e B 
 
 	 	 	 	 '   - - - - - - - - - - - - - - - - - - - - -   C o m m a n d s   w i t h   p a r a m e t e r s 
 
 	 	 C a s e   " P a u s e " 
 
 	 	 	 W a i t   S e c o n d s   G e t S e p a r a t e d S t r i n g ( C o m m a n d T e x t ,   1 ) 
 
 	 	 C a s e   " S a y " 
 
 	 	 	 T T S   S p e a k   M i d ( C o m m a n d T e x t ,   5 ) 
 
 	 	 	 W a i t   T T S r e a d y 
 
 	 	 	 '   - - - - - - - - - - - - - - - - - - - - - - - - -   U n r e c o g n i z e d   c o m m a n d 
 
 	 	 C a s e E l s e 
 
 	 	 	 W a i t   S e c o n d s   0 . 5 
 
 	 	 	 B e e p   2 0 0   5 0 0 
 
 	 	 	 P r i n t   " U n r e c o g n i z e d   c o m m a n d :   "   +   C o m m a n d T e x t 
 
 	 	 	 W a i t   S e c o n d s   0 . 5 
 
 	 E n d S e l e c t 
 
 	 C l e a r C o m m a n d 
 
 R e t u r n 
 
 
 
 L a b e l   C l e a r C o m m a n d 
 
 	 S l o t T e x t ( S l o t _ C o m m a n d s F r o m C o b o t )   =   " " 
 
 R e t u r n 
 
 
 
 L a b e l   E x e c B e e p 
 
 	 B e e p   4 4 0   3 0 0 
 
 	 W a i t   S e c o n d s   0 . 5 
 
 	 B e e p   4 4 0   3 0 0 
 
 R e t u r n 
 
 
 
 L a b e l   E x e c B e e p M u l t i p l e 
 
 	 F o r   v 1   =   1   T o   3 
 
 	 	 B e e p   8 8 0   4 0 0 
 
 	 	 W a i t   S e c o n d s   0 . 5 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 L a b e l   L o a d S e q u e n c e A 
 
 	 B e e p   1 6 6 0   2 0 0 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( L o a d S e q u e n c e   T e s t _ A . t x t ) 
 
 R e t u r n 
 
 
 
 L a b e l   L o a d S e q u e n c e B 
 
 	 B e e p   2 2 0 0   2 0 0 
 
 	 S e n d C o m m a n d ( S l o t _ C o m m a n d s T o C o b o t ) ( L o a d S e q u e n c e   T e s t _ B . t x t ) 
 
 R e t u r n 
 
 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 '     S E N D   C O M M A N D   ( d e f a u l t   t i m e o u t   =   0 . 5   S e c ) 
 
 '   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
 L a b e l   S e n d C o m m a n d 
 
 	 V a r i a b l e   N u m e r i c   S C 1               ' < - -   P a r a m e t e r   D e s t i n a t . - S l o t 
 
 	 V a r i a b l e   S t r i n g     S C 2               ' < - -   P a r a m e t e r   C o m m a n d - S t r i n g 
 
 	 V a r i a b l e   N u m e r i c   S C 3   =   0 . 5   ' < - -   T h e   t i m e o u t   i n   s e c o n d s 
 
 	 V a r i a b l e   N u m e r i c   S C 4 
 
 	 S l o t T e x t   S C 1   =   S C 2 
 
 	 F o r   S C 4   =   0 . 1   T o   S C 3   S t e p   0 . 1 
 
 	 	 I f   S l o t T e x t ( S C 1 )   =   " " 
 
 	 	 	 E x i t 
 
 	 	 E n d I f 
 
 	 	 W a i t   S e c o n d s   0 . 1 
 
 	 N e x t 
 
 R e t u r n 
 
 
 
 
 
 ' W A T C H   v 1 
 
 ' E X E C   D e s t X   =   1 2 
 
 